package com.qth.valet.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qth.valet.entity.po.OrderHistory;
import com.qth.valet.mapper.OrderHistoryMapper;
import com.qth.valet.service.OrderHistoryService;
import org.aspectj.weaver.ast.Or;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class OrderHistoryServiceImpl extends ServiceImpl<OrderHistoryMapper, OrderHistory> implements OrderHistoryService {
    @Async
    @Override
    public void saveOrderHistory(String orderId, Integer userId, Integer driverId, String operate) {
        OrderHistory orderHistory = new OrderHistory();
        orderHistory.setOrderId(orderId);
        orderHistory.setUserId(userId);
        orderHistory.setDriverId(driverId);
        orderHistory.setOperate(operate);
        orderHistory.setCreatedDate(new Date());

       this.save(orderHistory);
    }
}
